home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / basic / ScrollText.lha / ScrollText / ST_Font.asc < prev    next >
Encoding:
Text File  |  2000-08-29  |  1.8 KB  |  83 lines

  1.  
  2.  
  3. ; $VER: ST_Font.bb2 v1.1 (29.08.2000)
  4.  
  5. ; Author: Damir Arh
  6. ; E-mail: damir.arh@telesat.si
  7. ; WWW:    http://damir.gajba.net/
  8.  
  9. ; This source code is completely free. You can redistribute
  10. ; and/or modify it without any restrictions whatsoever.
  11.  
  12.  
  13. ;------------------------------------------------------------
  14.  
  15. ; This is a short program that converts 'ST_Font.iff' into
  16. ; 'ST_Font.dat' for use with 'Scroll Text' routines.
  17.  
  18. ; The program should be run from the directory, where the
  19. ; picture is located. Look at 'ScrollText.asc' for more
  20. ; info.
  21.  
  22. ;------------------------------------------------------------
  23.  
  24. #ST_Characters=41           ; number of font characters
  25.  
  26. WBStartup                   ; enable start from WB
  27.  
  28. ; some info
  29. NPrint ""
  30. NPrint "ST_Font v1.1 (29.08.2000)"
  31. NPrint ""
  32. NPrint "Author: Damir Arh"
  33. NPrint "E-mail: damir.arh@telesat.si"
  34. NPrint "WWW:    http://damir.gajba.net/"
  35. NPrint ""
  36.  
  37. ; get the data
  38. NPrint ""
  39. NPrint "Input picture data:"
  40. NPrint ""
  41. Print "Width (default 320)   : "
  42. ST_FontWidth.w=Edit(4)
  43. Print "Height (default 256)  : "
  44. ST_FontHeight.w=Edit(4)
  45. Print "Depth (default 5)     : "
  46. ST_FontDepth.b=Edit(2)
  47. Print "Font size (default 16): "
  48. ST_Size.b=Edit(3)
  49. NPrint ""
  50.  
  51. ;set the default data
  52. If ST_FontWidth=0 Then ST_FontWidth=320
  53. If ST_FontHeight=0 Then ST_FontHeight=256
  54. If ST_FontDepth=0 Then ST_FontDepth=5
  55. If ST_Size=0 Then ST_Size=16
  56.  
  57. ;get the picture
  58. BitMap 0,ST_FontWidth,ST_FontHeight,ST_FontDepth
  59. If Exists("ST_Font.iff")
  60.   LoadIFF "ST_Font.iff",0
  61. Else
  62.   NPrint "Can't find the picture. Quiting..."
  63.   NPrint ""
  64.   End
  65. EndIf
  66.  
  67. x.w=0 : y.w=0
  68. For i.b=0 To (#ST_Characters-1)   ; get the characters
  69.                                   ; from the picture
  70.   GetaShape i,x,y,ST_Size,ST_Size
  71.  
  72.   x=x+ST_Size
  73.   If x+ST_Size>ST_FontWidth
  74.     x=0 : y=y+ST_Size
  75.   EndIf
  76.  
  77. Next i
  78.  
  79. SaveShapes 0,#ST_Characters,"ST_Font.dat" ; save data
  80.  
  81. End
  82.  
  83.